[SPARK-39255][SQL][3.3] Improve error messages#36655
Closed
MaxGekk wants to merge 2 commits intoapache:branch-3.3from
Closed
[SPARK-39255][SQL][3.3] Improve error messages#36655MaxGekk wants to merge 2 commits intoapache:branch-3.3from
MaxGekk wants to merge 2 commits intoapache:branch-3.3from
Conversation
In the PR, I propose to improve errors of the following error classes: 1. NON_PARTITION_COLUMN - `a non-partition column name` -> `the non-partition column` 2. UNSUPPORTED_SAVE_MODE - `a not existent path` -> `a non existent path`. 3. INVALID_FIELD_NAME. Quote ids to follow the rules apache#36621. 4. FAILED_SET_ORIGINAL_PERMISSION_BACK. It is renamed to FAILED_PERMISSION_RESET_ORIGINAL. 5. NON_LITERAL_PIVOT_VALUES - Wrap error's expression by double quotes. The PR adds new helper method `toSQLExpr()` for that. 6. CAST_INVALID_INPUT - Add the recommendation: `... Correct the syntax for the value before casting it, or change the type to one appropriate for the value.` To improve user experience with Spark SQL by making error message more clear. Yes, it changes user-facing error messages. By running the affected test suites: ``` $ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite" $ build/sbt "sql/testOnly *QueryCompilationErrorsDSv2Suite" $ build/sbt "sql/testOnly *QueryCompilationErrorsSuite" $ build/sbt "sql/testOnly *QueryExecutionAnsiErrorsSuite" $ build/sbt "sql/testOnly *QueryExecutionErrorsSuite" $ build/sbt "sql/testOnly *QueryParsingErrorsSuite*" ``` Closes apache#36635 from MaxGekk/error-class-improve-msg-3. Lead-authored-by: Max Gekk <max.gekk@gmail.com> Co-authored-by: Maxim Gekk <max.gekk@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com> (cherry picked from commit 625afb4) Signed-off-by: Max Gekk <max.gekk@gmail.com>
Member
There was a problem hiding this comment.
Could you take a look at the following failure?
V1WriteFallbackSessionCatalogSuite:
[info] - InsertInto: when the table doesn't exist (52 milliseconds)
[info] - InsertInto: append to partitioned table - static clause (209 milliseconds)
[info] - InsertInto: static PARTITION clause fails with non-partition column *** FAILED *** (54 milliseconds)
[info] "PARTITION clause cannot contain the non-partition column: `id`." did not contain "PARTITION clause cannot contain a non-partition column name" (InsertIntoTests.scala:261)
cloud-fan
approved these changes
May 25, 2022
gengliangwang
approved these changes
May 25, 2022
Member
Author
|
Merging to 3.3. Thank you, @dongjoon-hyun @gengliangwang and @cloud-fan for review. |
MaxGekk
added a commit
that referenced
this pull request
May 25, 2022
### What changes were proposed in this pull request? In the PR, I propose to improve errors of the following error classes: 1. NON_PARTITION_COLUMN - `a non-partition column name` -> `the non-partition column` 2. UNSUPPORTED_SAVE_MODE - `a not existent path` -> `a non existent path`. 3. INVALID_FIELD_NAME. Quote ids to follow the rules #36621. 4. FAILED_SET_ORIGINAL_PERMISSION_BACK. It is renamed to RESET_PERMISSION_TO_ORIGINAL. 5. NON_LITERAL_PIVOT_VALUES - Wrap error's expression by double quotes. The PR adds new helper method `toSQLExpr()` for that. 6. CAST_INVALID_INPUT - Add the recommendation: `... Correct the syntax for the value before casting it, or change the type to one appropriate for the value.` This is a backport of #36635. ### Why are the changes needed? To improve user experience with Spark SQL by making error message more clear. ### Does this PR introduce _any_ user-facing change? Yes, it changes user-facing error messages. ### How was this patch tested? By running the affected test suites: ``` $ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite" $ build/sbt "sql/testOnly *QueryCompilationErrorsDSv2Suite" $ build/sbt "sql/testOnly *QueryCompilationErrorsSuite" $ build/sbt "sql/testOnly *QueryExecutionAnsiErrorsSuite" $ build/sbt "sql/testOnly *QueryExecutionErrorsSuite" $ build/sbt "sql/testOnly *QueryParsingErrorsSuite*" ``` Lead-authored-by: Max Gekk <max.gekkgmail.com> Co-authored-by: Maxim Gekk <max.gekkgmail.com> Signed-off-by: Max Gekk <max.gekkgmail.com> (cherry picked from commit 625afb4) Signed-off-by: Max Gekk <max.gekkgmail.com> Closes #36655 from MaxGekk/error-class-improve-msg-3-3.3. Authored-by: Max Gekk <max.gekk@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
In the PR, I propose to improve errors of the following error classes:
a non-partition column name->the non-partition columna not existent path->a non existent path.toSQLExpr()for that.... Correct the syntax for the value before casting it, or change the type to one appropriate for the value.This is a backport of #36635.
Why are the changes needed?
To improve user experience with Spark SQL by making error message more clear.
Does this PR introduce any user-facing change?
Yes, it changes user-facing error messages.
How was this patch tested?
By running the affected test suites:
Lead-authored-by: Max Gekk max.gekk@gmail.com
Co-authored-by: Maxim Gekk max.gekk@gmail.com
Signed-off-by: Max Gekk max.gekk@gmail.com
(cherry picked from commit 625afb4)
Signed-off-by: Max Gekk max.gekk@gmail.com